public class Main1 {
    public static void main(String[] args) {
        int[] arr = new int[1000];
        int[] hash = new int[1000];
        for (int i = 0; i < 1000; i++) {
            if (++hash[arr[i]] == 2) {
                System.out.println(arr[i]);
                break;
            }
        }
    }
}
